package StudyCode.summary.BufferAndChannel;

import java.io.*;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CreatingStreamFromChannel {
	public static void main(String[] argv) {
		try {
			File file = new File("E:/Copy/2.txt");
			FileChannel channel = new RandomAccessFile(file, "rw").getChannel();

			OutputStream os = Channels.newOutputStream(channel);
			InputStream is = Channels.newInputStream(channel);
			is.close();
			System.out.println("创建流结束");
		} catch (IOException ignored) {
		}
	}
}
